package com.boho.ecp.cart.action;

import java.sql.Connection;

import cn.boho.framework.actions.ActionImp;
import cn.boho.framework.context.ActionContext;
import cn.boho.framework.service.MessageService;

import com.boho.ecp.cart.service.CartService;

public class ClearCartAction extends ActionImp {

	@Override
	protected void doException(ActionContext atx, Exception ex) {
		atx.setErrorContext("UPDATE_PRODUCT_FAIL", MessageService.getMessage("UPDATE_PRODUCT_FAIL"), ex);
	}

	@Override
	protected int performExecute(ActionContext atx) throws Exception {
		Connection con = atx.getConection();
		CartService.clearCart(atx, con);
		return 1;
	}

	@Override
	protected int verifyParameters(ActionContext atx) throws Exception {
		return 1;
	}
}
